from aip import AipOcr

""" 你的 APPID AK SK """
APP_ID = '23653685'
API_KEY = 'sZaWN5RIQ8RNGx4sO4WhGIlq'
SECRET_KEY = 'YZmOesMjs5rIFII5VpD0idiheq4tWaCM'

client = AipOcr(APP_ID, API_KEY, SECRET_KEY)

""" 读取图片 """
def get_file_content(filePath):
    with open(filePath, 'rb') as fp:
        return fp.read()


image = get_file_content(r'D:\Documents\baiduAI\新建文件夹\ceshi.jpg.jpg')
k = client.accurate(image)
for i in k['words_result']:
    print(i['words'])


